﻿namespace HRM.CORE.REPORT
{
    using APP.HELPER.Utils.Security;
    using DevExpress.Utils;
    using DevExpress.XtraPrinting;
    using DevExpress.XtraPrinting.Shape;
    using DevExpress.XtraReports.UI;
    using HRM.CORE;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Drawing.Printing;

    public class rptEmployeeCard : XtraReport
    {
        private BottomMarginBand BottomMargin;
        private IContainer components;
        private DetailBand Detail;
        private HRM_EMPLOYEE l_Employee;
        private string m_Code;
        private string m_EmployeeCode;
        private int m_Level;
        private PageFooterBand PageFooter;
        private XRPictureBox ptEmployeePhoto;
        private XRPictureBox ptEmployeePhoto1;
        private XRPictureBox ptPhoto;
        private XRPictureBox ptPhoto1;
        private TopMarginBand TopMargin;
        private XRLabel txtCompany;
        private XRLabel txtCompany1;
        private XRLabel txtDepartment;
        private XRLabel txtDepartment1;
        private XRLabel txtEmployeeCode;
        private XRLabel txtEmployeeCode1;
        private XRLabel txtEmployeeName;
        private XRLabel txtEmployeeName1;
        private XRLabel txtFirstName;
        private XRLabel txtLastName;
        private XRLabel txtPosition;
        private XRLabel txtPosition1;
        private XRLabel txtWebsite;
        private XRLabel txtWebsite1;
        private XRLabel xrLabel3;
        private XRLabel xrLabel7;
        private XRShape xrShape1;
        private XRShape xrShape2;
        private XRShape xrShape3;
        private XRShape xrShape4;
        private XRShape xrShape5;
        private XRShape xrShape6;
        private XRShape xrShape7;
        private XRShape xrShape8;

        public rptEmployeeCard()
        {
            this.components = null;
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_EmployeeCode = "";
            this.InitializeComponent();
        }

        public rptEmployeeCard(string EmployeeCode)
        {
            this.components = null;
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_EmployeeCode = "";
            this.InitializeComponent();
            this.m_EmployeeCode = EmployeeCode;
        }

        public rptEmployeeCard(int Level, string Code)
        {
            this.components = null;
            this.l_Employee = new HRM_EMPLOYEE();
            this.m_Level = 0;
            this.m_Code = "";
            this.m_EmployeeCode = "";
            this.InitializeComponent();
            this.m_Level = Level;
            this.m_Code = Code;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            ShapeRectangle rectangle = new ShapeRectangle();
            ShapeRectangle rectangle2 = new ShapeRectangle();
            ShapeRectangle rectangle3 = new ShapeRectangle();
            ShapeRectangle rectangle4 = new ShapeRectangle();
            ShapeRectangle rectangle5 = new ShapeRectangle();
            ShapeRectangle rectangle6 = new ShapeRectangle();
            ShapeRectangle rectangle7 = new ShapeRectangle();
            ShapeRectangle rectangle8 = new ShapeRectangle();
            this.Detail = new DetailBand();
            this.ptPhoto = new XRPictureBox();
            this.txtDepartment1 = new XRLabel();
            this.txtPosition1 = new XRLabel();
            this.txtEmployeeName1 = new XRLabel();
            this.txtEmployeeCode1 = new XRLabel();
            this.ptEmployeePhoto1 = new XRPictureBox();
            this.txtCompany1 = new XRLabel();
            this.ptPhoto1 = new XRPictureBox();
            this.xrShape6 = new XRShape();
            this.xrShape5 = new XRShape();
            this.txtWebsite1 = new XRLabel();
            this.xrShape8 = new XRShape();
            this.xrShape7 = new XRShape();
            this.txtWebsite = new XRLabel();
            this.xrShape3 = new XRShape();
            this.txtCompany = new XRLabel();
            this.ptEmployeePhoto = new XRPictureBox();
            this.txtPosition = new XRLabel();
            this.txtDepartment = new XRLabel();
            this.txtEmployeeCode = new XRLabel();
            this.txtLastName = new XRLabel();
            this.txtFirstName = new XRLabel();
            this.txtEmployeeName = new XRLabel();
            this.xrLabel7 = new XRLabel();
            this.xrShape2 = new XRShape();
            this.xrShape1 = new XRShape();
            this.xrShape4 = new XRShape();
            this.xrLabel3 = new XRLabel();
            this.TopMargin = new TopMarginBand();
            this.BottomMargin = new BottomMarginBand();
            this.PageFooter = new PageFooterBand();
            this.BeginInit();
            this.Detail.Controls.AddRange(new XRControl[] { 
                this.ptPhoto, this.txtDepartment1, this.txtPosition1, this.txtEmployeeName1, this.txtEmployeeCode1, this.ptEmployeePhoto1, this.txtCompany1, this.ptPhoto1, this.xrShape6, this.xrShape5, this.txtWebsite1, this.xrShape8, this.xrShape7, this.txtWebsite, this.xrShape3, this.txtCompany, 
                this.ptEmployeePhoto, this.txtPosition, this.txtDepartment, this.txtEmployeeCode, this.txtLastName, this.txtFirstName, this.txtEmployeeName, this.xrLabel7, this.xrShape2, this.xrShape1, this.xrShape4, this.xrLabel3
             });
            this.Detail.HeightF = 396f;
            this.Detail.Name = "Detail";
            this.Detail.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.Detail.TextAlignment = TextAlignment.TopLeft;
            this.ptPhoto.LocationFloat = new PointFloat(80.70834f, 60.75002f);
            this.ptPhoto.Name = "ptPhoto";
            this.ptPhoto.SizeF = new SizeF(88.54166f, 58.33333f);
            this.ptPhoto.Sizing = ImageSizeMode.ZoomImage;
            this.txtDepartment1.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtDepartment1.LocationFloat = new PointFloat(797.9167f, 171.875f);
            this.txtDepartment1.Name = "txtDepartment1";
            this.txtDepartment1.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtDepartment1.SizeF = new SizeF(188.7083f, 17.70834f);
            this.txtDepartment1.StylePriority.UseFont = false;
            this.txtDepartment1.StylePriority.UseTextAlignment = false;
            this.txtDepartment1.Text = "txtDepartment";
            this.txtDepartment1.TextAlignment = TextAlignment.MiddleCenter;
            this.txtPosition1.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtPosition1.LocationFloat = new PointFloat(797.9167f, 152.875f);
            this.txtPosition1.Name = "txtPosition1";
            this.txtPosition1.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtPosition1.SizeF = new SizeF(188.7083f, 17.70834f);
            this.txtPosition1.StylePriority.UseFont = false;
            this.txtPosition1.StylePriority.UseTextAlignment = false;
            this.txtPosition1.Text = "txtPosition";
            this.txtPosition1.TextAlignment = TextAlignment.MiddleCenter;
            this.txtEmployeeName1.BackColor = Color.Transparent;
            this.txtEmployeeName1.BorderColor = Color.Transparent;
            this.txtEmployeeName1.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtEmployeeName1.LocationFloat = new PointFloat(797.9167f, 134.375f);
            this.txtEmployeeName1.Name = "txtEmployeeName1";
            this.txtEmployeeName1.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtEmployeeName1.SizeF = new SizeF(188.7083f, 17.70834f);
            this.txtEmployeeName1.StylePriority.UseBackColor = false;
            this.txtEmployeeName1.StylePriority.UseBorderColor = false;
            this.txtEmployeeName1.StylePriority.UseFont = false;
            this.txtEmployeeName1.StylePriority.UseTextAlignment = false;
            this.txtEmployeeName1.Text = "txtEmployeeName";
            this.txtEmployeeName1.TextAlignment = TextAlignment.MiddleCenter;
            this.txtEmployeeCode1.BorderColor = Color.Black;
            this.txtEmployeeCode1.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtEmployeeCode1.LocationFloat = new PointFloat(998.8335f, 152.875f);
            this.txtEmployeeCode1.Name = "txtEmployeeCode1";
            this.txtEmployeeCode1.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtEmployeeCode1.SizeF = new SizeF(98.95825f, 17.70834f);
            this.txtEmployeeCode1.StylePriority.UseBorderColor = false;
            this.txtEmployeeCode1.StylePriority.UseFont = false;
            this.txtEmployeeCode1.StylePriority.UseTextAlignment = false;
            this.txtEmployeeCode1.TextAlignment = TextAlignment.TopCenter;
            this.ptEmployeePhoto1.BorderColor = Color.Gainsboro;
            this.ptEmployeePhoto1.Borders = BorderSide.All;
            this.ptEmployeePhoto1.LocationFloat = new PointFloat(998.8335f, 50f);
            this.ptEmployeePhoto1.Name = "ptEmployeePhoto1";
            this.ptEmployeePhoto1.SizeF = new SizeF(98.95825f, 102.0833f);
            this.ptEmployeePhoto1.Sizing = ImageSizeMode.ZoomImage;
            this.ptEmployeePhoto1.StylePriority.UseBorderColor = false;
            this.ptEmployeePhoto1.StylePriority.UseBorders = false;
            this.txtCompany1.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtCompany1.LocationFloat = new PointFloat(797.9167f, 48.25001f);
            this.txtCompany1.Name = "txtCompany1";
            this.txtCompany1.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtCompany1.SizeF = new SizeF(188.7083f, 17.70834f);
            this.txtCompany1.StylePriority.UseFont = false;
            this.txtCompany1.StylePriority.UseTextAlignment = false;
            this.txtCompany1.Text = "txtCompany";
            this.txtCompany1.TextAlignment = TextAlignment.MiddleCenter;
            this.ptPhoto1.LocationFloat = new PointFloat(848.9583f, 67.95834f);
            this.ptPhoto1.Name = "ptPhoto1";
            this.ptPhoto1.SizeF = new SizeF(88.54166f, 58.33333f);
            this.ptPhoto1.Sizing = ImageSizeMode.ZoomImage;
            this.xrShape6.LocationFloat = new PointFloat(788.625f, 33.75003f);
            this.xrShape6.Name = "xrShape6";
            rectangle.Fillet = 20;
            this.xrShape6.Shape = rectangle;
            this.xrShape6.SizeF = new SizeF(320f, 181f);
            this.xrShape5.LocationFloat = new PointFloat(755.2917f, 4.000021f);
            this.xrShape5.Name = "xrShape5";
            rectangle2.Fillet = 20;
            this.xrShape5.Shape = rectangle2;
            this.xrShape5.SizeF = new SizeF(383f, 241f);
            this.txtWebsite1.Angle = 90f;
            this.txtWebsite1.BackColor = Color.Transparent;
            this.txtWebsite1.BorderColor = Color.Transparent;
            this.txtWebsite1.Font = new Font("Times New Roman", 11.25f, FontStyle.Bold);
            this.txtWebsite1.LocationFloat = new PointFloat(571.0417f, 35.75003f);
            this.txtWebsite1.Name = "txtWebsite1";
            this.txtWebsite1.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtWebsite1.SizeF = new SizeF(39.45831f, 316f);
            this.txtWebsite1.StylePriority.UseBackColor = false;
            this.txtWebsite1.StylePriority.UseBorderColor = false;
            this.txtWebsite1.StylePriority.UseFont = false;
            this.txtWebsite1.StylePriority.UseTextAlignment = false;
            this.txtWebsite1.Text = "www.perfect.com.vn";
            this.txtWebsite1.TextAlignment = TextAlignment.MiddleCenter;
            this.xrShape8.LocationFloat = new PointFloat(534.7084f, 33.75003f);
            this.xrShape8.Name = "xrShape8";
            rectangle3.Fillet = 20;
            this.xrShape8.Shape = rectangle3;
            this.xrShape8.SizeF = new SizeF(181f, 320f);
            this.xrShape7.LocationFloat = new PointFloat(504.375f, 3.000021f);
            this.xrShape7.Name = "xrShape7";
            rectangle4.Fillet = 20;
            this.xrShape7.Shape = rectangle4;
            this.xrShape7.SizeF = new SizeF(241f, 383f);
            this.txtWebsite.BackColor = Color.OldLace;
            this.txtWebsite.BorderColor = Color.PeachPuff;
            this.txtWebsite.Font = new Font("Times New Roman", 11.25f, FontStyle.Bold);
            this.txtWebsite.LocationFloat = new PointFloat(286.5f, 122.0833f);
            this.txtWebsite.Name = "txtWebsite";
            this.txtWebsite.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtWebsite.SizeF = new SizeF(176.9584f, 30.25004f);
            this.txtWebsite.StylePriority.UseBackColor = false;
            this.txtWebsite.StylePriority.UseBorderColor = false;
            this.txtWebsite.StylePriority.UseFont = false;
            this.txtWebsite.StylePriority.UseTextAlignment = false;
            this.txtWebsite.Text = "www.perfect.com.vn";
            this.txtWebsite.TextAlignment = TextAlignment.MiddleCenter;
            this.xrShape3.LocationFloat = new PointFloat(284.4583f, 35.74999f);
            this.xrShape3.Name = "xrShape3";
            rectangle5.Fillet = 20;
            this.xrShape3.Shape = rectangle5;
            this.xrShape3.SizeF = new SizeF(181f, 320f);
            this.txtCompany.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtCompany.LocationFloat = new PointFloat(33.4583f, 41.8751f);
            this.txtCompany.Name = "txtCompany";
            this.txtCompany.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtCompany.SizeF = new SizeF(179.3333f, 17.70834f);
            this.txtCompany.StylePriority.UseFont = false;
            this.txtCompany.StylePriority.UseTextAlignment = false;
            this.txtCompany.Text = "txtCompany";
            this.txtCompany.TextAlignment = TextAlignment.MiddleCenter;
            this.ptEmployeePhoto.BorderColor = Color.Gainsboro;
            this.ptEmployeePhoto.Borders = BorderSide.All;
            this.ptEmployeePhoto.LocationFloat = new PointFloat(63.12501f, 122.0833f);
            this.ptEmployeePhoto.Name = "ptEmployeePhoto";
            this.ptEmployeePhoto.SizeF = new SizeF(120.8334f, 128.7084f);
            this.ptEmployeePhoto.Sizing = ImageSizeMode.ZoomImage;
            this.ptEmployeePhoto.StylePriority.UseBorderColor = false;
            this.ptEmployeePhoto.StylePriority.UseBorders = false;
            this.txtPosition.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtPosition.LocationFloat = new PointFloat(35.83329f, 299.375f);
            this.txtPosition.Name = "txtPosition";
            this.txtPosition.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtPosition.SizeF = new SizeF(175.9583f, 17.70837f);
            this.txtPosition.StylePriority.UseFont = false;
            this.txtPosition.StylePriority.UseTextAlignment = false;
            this.txtPosition.Text = "txtPosition";
            this.txtPosition.TextAlignment = TextAlignment.MiddleCenter;
            this.txtDepartment.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtDepartment.LocationFloat = new PointFloat(35.83329f, 319.0833f);
            this.txtDepartment.Name = "txtDepartment";
            this.txtDepartment.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtDepartment.SizeF = new SizeF(175.9583f, 17.70834f);
            this.txtDepartment.StylePriority.UseFont = false;
            this.txtDepartment.StylePriority.UseTextAlignment = false;
            this.txtDepartment.Text = "txtDepartment";
            this.txtDepartment.TextAlignment = TextAlignment.MiddleCenter;
            this.txtEmployeeCode.BorderColor = Color.Black;
            this.txtEmployeeCode.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtEmployeeCode.LocationFloat = new PointFloat(63.12501f, 250.7917f);
            this.txtEmployeeCode.Name = "txtEmployeeCode";
            this.txtEmployeeCode.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtEmployeeCode.SizeF = new SizeF(120.8334f, 17.70833f);
            this.txtEmployeeCode.StylePriority.UseBorderColor = false;
            this.txtEmployeeCode.StylePriority.UseFont = false;
            this.txtEmployeeCode.StylePriority.UseTextAlignment = false;
            this.txtEmployeeCode.TextAlignment = TextAlignment.TopCenter;
            this.txtEmployeeCode.BeforePrint += new PrintEventHandler(this.txtEmployeeCode_BeforePrint);
            this.txtLastName.LocationFloat = new PointFloat(140.1668f, 355.75f);
            this.txtLastName.Name = "txtLastName";
            this.txtLastName.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtLastName.SizeF = new SizeF(74.2915f, 17.70834f);
            this.txtLastName.Text = "txtLastName";
            this.txtLastName.Visible = false;
            this.txtFirstName.LocationFloat = new PointFloat(35.83329f, 355.75f);
            this.txtFirstName.Name = "txtFirstName";
            this.txtFirstName.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtFirstName.SizeF = new SizeF(104.3335f, 17.70834f);
            this.txtFirstName.Text = "txtFirstName";
            this.txtFirstName.Visible = false;
            this.txtEmployeeName.BackColor = Color.OldLace;
            this.txtEmployeeName.BorderColor = Color.PeachPuff;
            this.txtEmployeeName.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtEmployeeName.LocationFloat = new PointFloat(35.83329f, 279.6666f);
            this.txtEmployeeName.Name = "txtEmployeeName";
            this.txtEmployeeName.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtEmployeeName.SizeF = new SizeF(175.9583f, 17.70834f);
            this.txtEmployeeName.StylePriority.UseBackColor = false;
            this.txtEmployeeName.StylePriority.UseBorderColor = false;
            this.txtEmployeeName.StylePriority.UseFont = false;
            this.txtEmployeeName.StylePriority.UseTextAlignment = false;
            this.txtEmployeeName.Text = "txtEmployeeName";
            this.txtEmployeeName.TextAlignment = TextAlignment.MiddleCenter;
            this.txtEmployeeName.BeforePrint += new PrintEventHandler(this.txtEmployeeName_BeforePrint);
            this.xrLabel7.ForeColor = Color.Silver;
            this.xrLabel7.LocationFloat = new PointFloat(35.83329f, 202.0833f);
            this.xrLabel7.Name = "xrLabel7";
            this.xrLabel7.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel7.SizeF = new SizeF(176.9583f, 17.70833f);
            this.xrLabel7.StylePriority.UseForeColor = false;
            this.xrLabel7.StylePriority.UseTextAlignment = false;
            this.xrLabel7.Text = "Ảnh";
            this.xrLabel7.TextAlignment = TextAlignment.MiddleCenter;
            this.xrShape2.LocationFloat = new PointFloat(33.45829f, 35.75f);
            this.xrShape2.Name = "xrShape2";
            rectangle6.Fillet = 20;
            this.xrShape2.Shape = rectangle6;
            this.xrShape2.SizeF = new SizeF(181f, 320f);
            this.xrShape1.LocationFloat = new PointFloat(5.833334f, 5f);
            this.xrShape1.Name = "xrShape1";
            rectangle7.Fillet = 20;
            this.xrShape1.Shape = rectangle7;
            this.xrShape1.SizeF = new SizeF(241f, 383f);
            this.xrShape4.LocationFloat = new PointFloat(254.375f, 5.000003f);
            this.xrShape4.Name = "xrShape4";
            rectangle8.Fillet = 20;
            this.xrShape4.Shape = rectangle8;
            this.xrShape4.SizeF = new SizeF(241f, 383f);
            this.xrLabel3.ForeColor = Color.Silver;
            this.xrLabel3.LocationFloat = new PointFloat(984.2501f, 97.5f);
            this.xrLabel3.Name = "xrLabel3";
            this.xrLabel3.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel3.SizeF = new SizeF(124.3749f, 17.70834f);
            this.xrLabel3.StylePriority.UseForeColor = false;
            this.xrLabel3.StylePriority.UseTextAlignment = false;
            this.xrLabel3.Text = "Ảnh";
            this.xrLabel3.TextAlignment = TextAlignment.MiddleCenter;
            this.TopMargin.HeightF = 0f;
            this.TopMargin.Name = "TopMargin";
            this.TopMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.TopMargin.TextAlignment = TextAlignment.TopLeft;
            this.BottomMargin.HeightF = 0f;
            this.BottomMargin.Name = "BottomMargin";
            this.BottomMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.BottomMargin.TextAlignment = TextAlignment.TopLeft;
            this.PageFooter.HeightF = 0f;
            this.PageFooter.Name = "PageFooter";
            base.Bands.AddRange(new Band[] { this.Detail, this.TopMargin, this.BottomMargin, this.PageFooter });
            base.Font = new Font("Times New Roman", 9.75f);
            base.Landscape = true;
            base.Margins = new Margins(0, 0, 0, 0);
            base.PageHeight = 0x33b;
            base.PageWidth = 0x491;
            base.PaperKind = PaperKind.A4;
            base.Version = "9.3";
            this.BeforePrint += new PrintEventHandler(this.rptListEmployee_BeforePrint);
            this.EndInit();
        }

        private void LoadAllData()
        {
            DataSet set = new DataSet();
            DataTable table = new DataTable();
            table = this.l_Employee.GetListCurrentNow(this.m_Level, this.m_Code, 1);
            set.Tables.Add(table);
            base.DataSource = set;
            this.ptEmployeePhoto.DataBindings.Add("Image", base.DataSource, "Photo");
            this.txtEmployeeCode.DataBindings.Add("Text", base.DataSource, "EmployeeCode");
            this.txtFirstName.DataBindings.Add("Text", base.DataSource, "FirstName");
            this.txtLastName.DataBindings.Add("Text", base.DataSource, "LastName");
            this.txtDepartment.DataBindings.Add("Text", base.DataSource, "DepartmentName");
            this.txtPosition.DataBindings.Add("Text", base.DataSource, "Position");
            this.ptEmployeePhoto1.DataBindings.Add("Image", base.DataSource, "Photo");
            this.txtEmployeeCode1.DataBindings.Add("Text", base.DataSource, "EmployeeCode");
            this.txtDepartment1.DataBindings.Add("Text", base.DataSource, "DepartmentName");
            this.txtPosition1.DataBindings.Add("Text", base.DataSource, "Position");
        }

        private void LoadData()
        {
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(this.m_EmployeeCode);
            this.ptEmployeePhoto.Image = hrm_employee.Photo;
            this.txtEmployeeCode.Text = hrm_employee.EmployeeCode;
            this.txtFirstName.Text = hrm_employee.FirstName;
            this.txtLastName.Text = hrm_employee.LastName;
            this.txtDepartment.Text = hrm_employee.DepartmentName;
            this.txtPosition.Text = hrm_employee.Position;
            this.ptEmployeePhoto1.Image = hrm_employee.Photo;
            this.txtEmployeeCode1.Text = hrm_employee.EmployeeCode;
            this.txtDepartment1.Text = hrm_employee.DepartmentName;
            this.txtPosition1.Text = hrm_employee.Position;
        }

        private void rptListEmployee_BeforePrint(object sender, PrintEventArgs e)
        {
            if (this.m_EmployeeCode == "")
            {
                this.LoadAllData();
            }
            else
            {
                this.LoadData();
            }
            ////if (MyInfo.Get(MyEncryption.Encrypt("ERP01", "123654", true)) == "OK")
            {
                this.txtCompany.Text = "";//MyInfo.Company.ToUpper();
                this.ptPhoto.Image = null;// MyInfo.Photo;
                this.txtWebsite.Text = this.txtWebsite1.Text = "";//MyInfo.WebSite;
                this.txtCompany1.Text = "";//MyInfo.Company.ToUpper();
                this.ptPhoto1.Image = null;//MyInfo.Photo;
                this.txtWebsite1.Text = this.txtWebsite1.Text = "";//MyInfo.WebSite;
            }
        }

        private void txtEmployeeCode_BeforePrint(object sender, PrintEventArgs e)
        {
        }

        private void txtEmployeeName_BeforePrint(object sender, PrintEventArgs e)
        {
            this.txtEmployeeName.Text = this.txtEmployeeName1.Text = (this.txtFirstName.Text + " " + this.txtLastName.Text).ToUpper();
        }
    }
}

